package com.wlh.animation.basic;/*
 * Copyright (C) 2016 Facishare Technology Co., Ltd. All Rights Reserved.
 */

import com.wlh.animation.R;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * Created by weilh on 2016/1/22.
 */
public class BasicAnimationAct extends AppCompatActivity {
    private ListView list;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_basic_anim);
        list = (ListView) findViewById(R.id.list);
        list.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, new String[]{"平移动画", "透明动画", "旋转动画", "缩放动画", "动画集合"} ));
        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                switch (position) {
                    case 0:
                        startActivity(new Intent(BasicAnimationAct.this, TranslateAct.class));
                        break;
                    case 1:
                        startActivity(new Intent(BasicAnimationAct.this, AlphaAnimationAct.class));
                        break;
                    case 2:
                        startActivity(new Intent(BasicAnimationAct.this, RotateAnimationAct.class));
                        break;
                    case 3:
                        startActivity(new Intent(BasicAnimationAct.this, ScaleAnimationAct.class));
                        break;
                    case 4:
                        startActivity(new Intent(BasicAnimationAct.this, AnimationSetAct.class));
                        break;
                }
            }
        });
    }

}
